package com.lz.ovuola.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * 硬件检测数据分析表
 * 
 * @author fz
 *
 */
@Table(name = "physiological_data", uniqueConstraints = { @UniqueConstraint(columnNames = { "id" }) })
@Entity(name = "physiologicalDataDo")
public class PhysiologicalDataDo extends BaseDo {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2807030058896135748L;
	@Id
	@GeneratedValue
	private Integer id;
	/**
	 * 用户id
	 */
	@Column(name = "user_id", nullable = false)
	private Integer userId;

	@Column(name = "ch1r_h")
	private Float ch1rh;

	@Column(name = "ch1r_l")
	private Float ch1rl;

	@Column(name = "ch2r_h")
	private Float ch2rh;

	@Column(name = "ch2r_l")
	private Float ch2rl;

	@Column(name = "ch3r")
	private Float ch3r;

	@Column(name = "ch1v_l")
	private Float ch1vl;

	@Column(name = "ch2v_l")
	private Float ch2vl;

	/**
	 * 温度
	 */
	@Column(name = "temperature")
	private Float temperature;

	/**
	 * 激素水平
	 */
	@Column(name = "hormone_levels")
	private Float hormoneLevels;

	/**
	 * 含水量
	 */
	@Column(name = "water_content")
	private Float waterContent;

	/**
	 * 体质平衡
	 */
	@Column(name = "physiological_balance")
	private Float physiologicalBalance;

	/**
	 * 排卵率
	 */
	@Column(name = "pregnancy_rate")
	private Float pregnancyRate;

	/**
	 * 是否例假 1：例假 2：非例假
	 */
	@Column(name = "is_menstrual")
	private Integer menstrual;

	/**
	 * 是否生病： 1：生病 2：未生病
	 */
	@Column(name = "is_sick")
	private Integer sick;

	/**
	 * 牙龈出血
	 */
	@Column(name = "leeding_gums")
	private Integer leedingGums;

	/**
	 * 本次生理周期开始日期
	 */
	@Column(name = "start_time")
	private Date startTime;

	/**
	 * 本次生理周期结束日期
	 */
	@Column(name = "end_time")
	private Date endTime;

	/**
	 * 预估排卵日
	 */
	@Column(name = "estimate_ovulation_time")
	private Date estimateOvulationTime;

	/**
	 * 预估下次例假开始日期 not null
	 */
	@Column(name = "estimate_next_start_time")
	private Date estimateNextStartTime;

	/**
	 * 1、例假期和卵泡成熟期：多少天后排卵 2、排卵日 ：几点排卵 3、黄体期：已排卵
	 */
	@Column(name = "estimate_ovulation_time_description")
	private String estimateOvulationTimeDescription;

	/**
	 * 易孕率描述
	 */
	@Column(name = "pregnancy_rate_description")
	private String pregnancyRateDescription;

	/**
	 * 1、升高 2、降低 3、暂无
	 */
	@Column(name = "water_content_description")
	private String waterContentDescription;

	/**
	 * 1：例假期 2：卵泡成熟期 3: 排卵日 4：黄体期
	 */
	@Column(name = "physiological_stage")
	private String physiologicalStage;

	/**
	 * 1: 公式A 2：公式B
	 */
	@Column(name = "formula")
	private Integer formula;

	// 创建时间 not null
	@Column(name = "create_time", nullable = false)
	private Date createTime;
	// 更新时间 not null
	@Column(name = "update_time", nullable = false)
	private Date updateTime;

	/**
	 * 检测时间
	 */
	@Column(name = "detection_time")
	private Date detectionTime;

	public PhysiologicalDataDo() {
		super();
		// TODO Auto-generated constructor stub
	}

	public PhysiologicalDataDo(Integer userId, Float ch1rh, Float ch1rl,
			Float ch2rh, Float ch2rl, Float ch3r, Float ch1vl, Float ch2vl,
			Integer sick, Integer leedingGums, Date createTime,
			Date updateTime, Date detectionTime) {
		super();
		this.userId = userId;
		this.ch1rh = ch1rh;
		this.ch1rl = ch1rl;
		this.ch2rh = ch2rh;
		this.ch2rl = ch2rl;
		this.ch3r = ch3r;
		this.ch1vl = ch1vl;
		this.ch2vl = ch2vl;
		this.sick = sick;
		this.leedingGums = leedingGums;
		this.createTime = createTime;
		this.updateTime = updateTime;
		this.detectionTime = detectionTime;
	}


	public PhysiologicalDataDo(Integer userId, Float ch1rh,
			Float ch1rl, Float ch2rh, Float ch2rl, Float ch3r, Float ch1vl,
			Float ch2vl, Float waterContent, Integer menstrual, Integer sick,
			Integer leedingGums, Date startTime, Date endTime,
			Date estimateOvulationTime, Date estimateNextStartTime,
			String estimateOvulationTimeDescription,
			String pregnancyRateDescription, String physiologicalStage,
			Integer formula, Date createTime, Date updateTime,
			Date detectionTime) {
		super();
		this.userId = userId;
		this.ch1rh = ch1rh;
		this.ch1rl = ch1rl;
		this.ch2rh = ch2rh;
		this.ch2rl = ch2rl;
		this.ch3r = ch3r;
		this.ch1vl = ch1vl;
		this.ch2vl = ch2vl;
		this.waterContent = waterContent;
		this.menstrual = menstrual;
		this.sick = sick;
		this.leedingGums = leedingGums;
		this.startTime = startTime;
		this.endTime = endTime;
		this.estimateOvulationTime = estimateOvulationTime;
		this.estimateNextStartTime = estimateNextStartTime;
		this.estimateOvulationTimeDescription = estimateOvulationTimeDescription;
		this.pregnancyRateDescription = pregnancyRateDescription;
		this.physiologicalStage = physiologicalStage;
		this.formula = formula;
		this.createTime = createTime;
		this.updateTime = updateTime;
		this.detectionTime = detectionTime;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public Float getCh1rh() {
		return ch1rh;
	}

	public void setCh1rh(Float ch1rh) {
		this.ch1rh = ch1rh;
	}

	public Float getCh1rl() {
		return ch1rl;
	}

	public void setCh1rl(Float ch1rl) {
		this.ch1rl = ch1rl;
	}

	public Float getCh2rh() {
		return ch2rh;
	}

	public void setCh2rh(Float ch2rh) {
		this.ch2rh = ch2rh;
	}

	public Float getCh2rl() {
		return ch2rl;
	}

	public void setCh2rl(Float ch2rl) {
		this.ch2rl = ch2rl;
	}

	public Float getCh3r() {
		return ch3r;
	}

	public void setCh3r(Float ch3r) {
		this.ch3r = ch3r;
	}

	public Float getCh1vl() {
		return ch1vl;
	}

	public void setCh1vl(Float ch1vl) {
		this.ch1vl = ch1vl;
	}

	public Float getCh2vl() {
		return ch2vl;
	}

	public void setCh2vl(Float ch2vl) {
		this.ch2vl = ch2vl;
	}

	public Float getTemperature() {
		return temperature;
	}

	public void setTemperature(Float temperature) {
		this.temperature = temperature;
	}

	public Float getHormoneLevels() {
		return hormoneLevels;
	}

	public void setHormoneLevels(Float hormoneLevels) {
		this.hormoneLevels = hormoneLevels;
	}

	public Float getWaterContent() {
		return waterContent;
	}

	public void setWaterContent(Float waterContent) {
		this.waterContent = waterContent;
	}

	public Float getPhysiologicalBalance() {
		return physiologicalBalance;
	}

	public void setPhysiologicalBalance(Float physiologicalBalance) {
		this.physiologicalBalance = physiologicalBalance;
	}

	public Float getPregnancyRate() {
		return pregnancyRate;
	}

	public void setPregnancyRate(Float pregnancyRate) {
		this.pregnancyRate = pregnancyRate;
	}

	public Integer getMenstrual() {
		return menstrual;
	}

	public void setMenstrual(Integer menstrual) {
		this.menstrual = menstrual;
	}

	public Integer getSick() {
		return sick;
	}

	public void setSick(Integer sick) {
		this.sick = sick;
	}

	public Integer getLeedingGums() {
		return leedingGums;
	}

	public void setLeedingGums(Integer leedingGums) {
		this.leedingGums = leedingGums;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public Date getEstimateOvulationTime() {
		return estimateOvulationTime;
	}

	public void setEstimateOvulationTime(Date estimateOvulationTime) {
		this.estimateOvulationTime = estimateOvulationTime;
	}

	public Date getEstimateNextStartTime() {
		return estimateNextStartTime;
	}

	public void setEstimateNextStartTime(Date estimateNextStartTime) {
		this.estimateNextStartTime = estimateNextStartTime;
	}

	public String getEstimateOvulationTimeDescription() {
		return estimateOvulationTimeDescription;
	}

	public void setEstimateOvulationTimeDescription(
			String estimateOvulationTimeDescription) {
		this.estimateOvulationTimeDescription = estimateOvulationTimeDescription;
	}

	public String getPregnancyRateDescription() {
		return pregnancyRateDescription;
	}

	public void setPregnancyRateDescription(String pregnancyRateDescription) {
		this.pregnancyRateDescription = pregnancyRateDescription;
	}

	public String getWaterContentDescription() {
		return waterContentDescription;
	}

	public void setWaterContentDescription(String waterContentDescription) {
		this.waterContentDescription = waterContentDescription;
	}

	public String getPhysiologicalStage() {
		return physiologicalStage;
	}

	public void setPhysiologicalStage(String physiologicalStage) {
		this.physiologicalStage = physiologicalStage;
	}

	public Integer getFormula() {
		return formula;
	}

	public void setFormula(Integer formula) {
		this.formula = formula;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Date getDetectionTime() {
		return detectionTime;
	}

	public void setDetectionTime(Date detectionTime) {
		this.detectionTime = detectionTime;
	}

	public static PhysiologicalDataDo custom(Integer userId, Float ch1rh,
			Float ch1rl, Float ch2rh, Float ch2rl, Float ch3r, Float ch1vl,
			Float ch2vl, Float waterContent, Integer menstrual, Integer sick,
			Integer leedingGums, Date startTime, Date endTime,
			Date estimateOvulationTime, Date estimateNextStartTime,
			String estimateOvulationTimeDescription,
			String pregnancyRateDescription, String physiologicalStage,
			Integer formula,
			Date detectionTime) {
		final Date now = new Date();
		final PhysiologicalDataDo physiologicalDataDo = new PhysiologicalDataDo(
				userId, ch1rh, ch1rl, ch2rh, ch2rl, ch3r, ch1vl, ch2vl,
				waterContent, menstrual, sick, leedingGums, startTime, endTime,
				estimateOvulationTime, estimateNextStartTime,
				estimateOvulationTimeDescription, pregnancyRateDescription,
				physiologicalStage, formula, now, now, detectionTime);
		return physiologicalDataDo;
	}
}
